//
//  ZhiFuViewFangShiBtn.m
//  NBProduct
//
//  Created by ping on 15/11/13.
//  Copyright (c) 2015年 ping. All rights reserved.
//

#import "ZhiFuViewFangShiBtn.h"

@implementation ZhiFuViewFangShiBtn

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
      
        [self ksc];
          _height = 50 * _kscH;
        [self initView];
    }
    
    return self;
}

-(void)initView{
    self.backgroundColor = [UIColor whiteColor];
    UILabel *lineLab = [[UILabel alloc] initWithFrame:CGRectMake(13*_kscW, 0, KScreenWidth-13*_kscW, 0.5)];
    lineLab.backgroundColor = XiaHuaXianCOLOR;
    [self addSubview:lineLab];
    
    _tuBiaoImage = [[UIImageView alloc]initWithFrame:CGRectMake(18 * _kscH, (_height - 17*_kscH)/2.0, 17 * _kscH, 17*_kscH)];
    
    [self addSubview:_tuBiaoImage];
    
    _namelabel = [[BaseLabel alloc]initWithFrame:CGRectMake(_tuBiaoImage.right + 13 * _kscW, 12*_kscH, 100 * _kscW, 14*_kscH)];

    _namelabel.myfont = PuTongFont-1.0f;
    [self addSubview:_namelabel];
    
    _tipLab = [[BaseLabel alloc] initWithFrame:CGRectMake(_namelabel.left, _namelabel.bottom+3*_kscH, KScreenWidth-_namelabel.left - 70*_kscW, 10*_kscH) andFont:9.0f];
    //_tipLab.textColor = [UIColor grayColor];
    [self addSubview:_tipLab];
    
    _gouXuanImage = [[UIImageView alloc]initWithFrame:CGRectMake(KScreenWidth - 38 * _kscW, (_height - 20 * _kscW)/2, 20 * _kscW, 20 * _kscH)];
    _gouXuanImage.image = [UIImage imageNamed:@"未选中"];
    [self addSubview:_gouXuanImage];

}


-(void)ksc{
    if (KScreenHeight == 480 ) {
        _kscH = 1;
        _kscW = 1;
    }
    else
    {
        _kscH = KScreenHeight / 568;
        _kscW = KScreenWidth / 320;
    }
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
